Windows: add rename support - #934
Merged
Merged
Conversation
talex5
approved these changes
Sep 9, 2026
talex5
left a comment
Collaborator
There was a problem hiding this comment.
I don't know much about Windows renaming, but this looks reasonable to me.
Contributor
Author
|
I'm still digging through MSDN to see if there's something simpler for more atomic renames, but I can't find anything... |
This is somewhat more complex than expected since Windows behaves differently for overwriting files or directories, and the more modern MoveFileEx is path based and so unsuitable for our 'at' based handle approach. However, the lower level implementation here using the 'traditional' Win32 APIs works fine on the NTFS and FAT32 volumes I tried it on Co-authored-by: Thomas Leonard <talex5@gmail.com>
Contributor
Author
|
I'm not having much success with MSDN, so given how localised this change it I've made a note to improve it later on, but the feature's useful now! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is somewhat more complex than expected since Windows behaves differently for overwriting files or directories, and the more modern MoveFileEx is path based and so unsuitable for our 'at' based handle approach.
However, the lower level implementation here using the 'traditional' Win32 APIs works fine on the NTFS and FAT32 volumes I tried it on. Note that FAT just doesnt support renaming onto directories so will fail.
This let's forester cram tests get a little further! #931